package com.apestech.framework.config;

import com.apestech.formwork.xml.core.NodeVar;
import com.apestech.formwork.xml.core.var.NodeVarSql;
import com.apestech.framework.xml.sql.SqlNodeVar;
import com.apestech.framework.util.ReflectUtil;
import com.apestech.framework.xml.pub.WriteXml;
import org.dom4j.Element;
import org.junit.Test;


/**
 * @author hup
 * @create 2018-12-05-11:56
 */
public class SysConfig {

    @Test
    public void iniAllVarInfo() throws Exception {
        WriteXml xml=new WriteXml();
        xml.createXml();
        Element root=xml.getRoot();
        writeConfig(root, "pubxml", NodeVar.class.getName());
        writeConfig(root, "sql", NodeVarSql.class.getName());
        writeConfig(root, "sqlvar", SqlNodeVar.class.getName());
        xml.writeXml("d://1.xml");
    }

    private void writeConfig(Element root, String qname, String className) throws Exception {
        SourceConfig config=new SourceConfig(ReflectUtil.getClassMethods(className), root.addElement(qname));
    }

}
